package taller2.controller.listeners.GraphCreator;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import taller2.utils.Constants;
import taller2.utils.Utils;
import taller2.view.menus.CreatorMenus.GraphCreatorMenu;
import taller2.view.windows.CreatorWindows.GraphCreatorWindow;

public class GraphCreatorApplyChangesButtonListener implements ActionListener {
	private GraphCreatorWindow window;
	private GraphCreatorMenu menu;
	
	// constructor
	public GraphCreatorApplyChangesButtonListener(GraphCreatorWindow window,GraphCreatorMenu menu){
		this.window = window;
		this.menu = menu;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		Utils.deleteFiles(Constants.savedGraphsPath);
		window.applyChanges();
		menu.unselectButtons();
	}

}
